-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using delegate instead fixed function #31
Closed
yvoinov
wants to merge
64
commits into
inkooboo:master
from
yvoinov:using-delegate-instead-fixed-function
Closed
Using delegate instead fixed function #31
yvoinov
wants to merge
64
commits into
inkooboo:master
from
yvoinov:using-delegate-instead-fixed-function
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spin lock replaced/affinity support added. Also size_t replaced to std::size_t. :)
Replaced post-increment in affinity code to pre-increment.
Make affinity controllable by boolean flag. On supported platforms affinity will always build, to turn it on in application just enough to set tp::v_affinity = true; in application.
Polishing affinity code (one condition less)
FreeBSD affinity support added.
Code formatting.
Unnesessary include removed.
We're should bind only online cores.
Fix job stealing. It also should send notification, otherwise steal() can't wake up worker.
Better fix for job stealing.
Changes from inkooboo#24 are incorporated. Conditional variables instead spin-lock are kept as well.
Fix overnotification when tryPost.
….com/yvoinov/thread-pool-cpp into thread-pool-cpp-round-robin-stealing
This reverts commit e9d8206.
This reverts commit 75eeabf.
Refactoring. Partial rollback 2e5151b.
After profiling and testing, rollback FixedFunction() instead std::function.
A new post() often occurs in imputation of the sleep sequence. Interrupting the sequence here and performing pop() allows to somewhat reduce pool latency.
This reverts commit 9187bdc.
A new post() often occurs during a sleep sequence. Interrupting the sequence and performing pop() allows you to somewhat reduce pool latency.
Oracle Developer Studio cannot compile fixed_function.hpp. So, to build pool with this compiler, we're just use std::function instead fixed function implementation.
Logical error in threadFunc() fixed; other minor fixes.
….com/yvoinov/thread-pool-cpp into thread-pool-cpp-round-robin-stealing
Some refactoring affinity code
Sleep counter implementation
….com/yvoinov/thread-pool-cpp into thread-pool-cpp-round-robin-stealing
Rework ThreadPoolImpl<Task, Queue>::post(Handler&& handler) to prevent accidentally exception when thread pool falsely full.
Note: std::exchange is C++14
Performance improvement. This micro optimization reduce latency with job stealing up to 1-2 ms.
SLEEP_CNT renamed to IDLE_CNT; made fully C++11 compatible
Less unnesessary code generation
- Using CV wait_for in post() instead sleep_for - Fix post() description - Requires more strict barriers in MPMC to prevent hangs - Vector include moved to appropriate place
Queue-overflow proofed post() implemented for thread pool.
Removed unnesessary lambda.
Avoid warning 'Unused variable w'
It is non-requires to SunPRO conditional compilation for compatibility
Sorry, wrong click made. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.